/*
  学习目标：使用单独的文件,维护路由
  步骤：
*/

// 1. 新建src/router/index.js文件
import VueRouter from "vue-router";
import Vue from "vue";

Vue.use(VueRouter); //会自动注册两个全局组件: router-view router-link

// 💥💥小心路径的改变
import HmFind from "../views/HmFind.vue";
import HmFriend from "../views/HmFriend.vue";
import HmMy from "../views/HmMy.vue";
import HmHome from "../views/HmHome.vue";

const routes = [
  { path: "/find", component: HmFind },
  { path: "/friend", component: HmFriend },
  { path: "/my", component: HmMy },
  { path: "/home", component: HmHome },
];
const router = new VueRouter({
  routes,
});

// 2. 导入配置好的路由实例
export default router;
